package views.accueil;

import java.awt.BorderLayout;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

import main.NotInitializedException;
import main.SingletonJeu;

public class PanelAccueilFinances extends JPanel
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	JLabel lblCompteCourant;
	public PanelAccueilFinances()
	{
		setLayout(new BorderLayout(0, 0));

		JPanel panel = new JPanel();
		add(panel, BorderLayout.WEST);

		JPanel panel_2 = new JPanel();
		add(panel_2, BorderLayout.CENTER);
		panel_2.setLayout(new BorderLayout(0, 0));


		try
		{
			lblCompteCourant = new JLabel("Compte courant : " + SingletonJeu.getLeJeu().getLeJoueur().getBudget().getBudgetTotal()+" euros");
			lblCompteCourant.setFont(new Font("Tahoma", Font.BOLD, 18));
			panel_2.add(lblCompteCourant, BorderLayout.CENTER);
			JPanel panel_1 = new JPanel();
			this.add(panel_1, BorderLayout.EAST);
			
		} catch (NotInitializedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		this.setBorder(BorderFactory.createTitledBorder("Finances"));
	}

	public void refresh() throws NotInitializedException
	{
		System.out.println(SingletonJeu.getLeJeu().getLeJoueur().getBudget().getBudgetTotal());
		lblCompteCourant.setText("Compte courant : " + SingletonJeu.getLeJeu().getLeJoueur().getBudget().getBudgetTotal()+" euros");

	}

}
